#ifndef MYAPPLICATION_H
#define MYAPPLICATION_H
#include "ogreapplication.h"
#include "visualisation.h"
#include <OgreErrorDialog.h>
#include <OgreKeyEvent.h>
#include <iostream>
#define ZOOM 100
#define SCALE 25
#define FACTOR 4
#define XCAMERASTART -100
#define YCAMERASTART 200
#define ZCAMERASTART 1000
#define DOUBLECLICKDELAY 500

using namespace Ogre;
using namespace std;

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Interface of MyApplication
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class MyApplication : public OgreApplication, Ogre::MouseListener
{
public:
	MyApplication();
	~MyApplication();
	
    virtual void init();
    virtual bool frameStarted(const Ogre::FrameEvent& evt);
    virtual bool frameEnded(const Ogre::FrameEvent& evt);
    virtual void keyPressed(Ogre::KeyEvent* e);
    virtual void keyClicked(Ogre::KeyEvent* e);
    virtual void keyReleased(Ogre::KeyEvent* e);

	//configuration des overlays
	void configOverlay();

    virtual void mousePressed(Ogre::MouseEvent*){};
    virtual void mouseReleased(Ogre::MouseEvent*);
    virtual void mouseClicked(Ogre::MouseEvent*){};
    virtual void mouseEntered(Ogre::MouseEvent*){};
    virtual void mouseExited(Ogre::MouseEvent*){};

	//setters
	void setVisualisation(Visualisation * v);

    Ogre::RaySceneQuery* mRaySceneQuery;
    Ogre::Entity*        mSelected;
    Ogre::Overlay*  mPanelOverlay;
    Ogre::String nomFic;
    Ogre::OverlayElement* fileOverlay;
	Ogre::OverlayElement* debugOverlay;
    int nbLignes;
    Ogre::MaterialPtr ligneMaterial;
    Ogre::Timer* mButtonTimer;
	Visualisation* myVisualisation;

};


#endif
